#!/usr/bin/python
# -*- coding: UTF-8 -*-

import MySQLdb


# 打开数据库连接
db = MySQLdb.connect("localhost", "root", "123", "oa", charset='utf8' )
cu=db.cursor();
sql="select * from user"
cu.execute(sql)
list=cu.fetchall()
for i in list:
    id=i[0]
    name=i[1]
    print (id,name)